//
//  SleepCardStackView.swift
//  ExtremeHealth
//
//  Created by Zhongkai Li 李忠凯 on 2018/9/29.
//  Copyright © 2018 GanDongKeJi. All rights reserved.
//

import SwiftFontName

class SleepCardStackView: UIStackView {
    override init(frame: CGRect) {
        super.init(frame: frame)
        axis = .vertical
        alignment = .center
        spacing = 2

        let leftTimeLabel = UILabel()
        leftTimeLabel.text = "2h35min"
        leftTimeLabel.font = UIFont(name: FontName.PingFangSCLight, size: 10)
        leftTimeLabel.textColor = UIColor("#333333")
        addArrangedSubview(leftTimeLabel)

        let colorView = UIView()
        colorView.backgroundColor = .red
        addArrangedSubview(colorView)
        NSLayoutConstraint.activate([
            colorView.widthAnchor.constraint(equalToConstant: 14),
            colorView.heightAnchor.constraint(equalToConstant: 6)
            ])

        let descLabel = UILabel()
        descLabel.text = "深睡"
        descLabel.font = UIFont(name: FontName.PingFangSCLight, size: 10)
        descLabel.textColor = UIColor("#333333")
        addArrangedSubview(descLabel)
    }

    required init(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
